import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'

const router = createRouter({
    history: createWebHashHistory('./'), // 使用 hash 模式并指定 base 路径
    routes: [
        {
            path: '/',
            name: 'home',
            component: () => import('@/views/Root.vue'),
            redirect: {name: 'discover'},
            children: [
                {
                    path: 'discover', // 推荐
                    name: 'discover',
                    component: () => import('@/views/discover/index.vue')
                },
                {
                    path: 'featured',
                    name: 'featured',
                    component: () => import('@/views/featured/index.vue')
                },
                {
                    path: 'podcast',
                    name: 'podcast',
                    component: () => import('@/views/podcast/index.vue')
                },
                {
                    path: 'stream',
                    name: 'stream',
                    component: () => import('@/views/stream/index.vue')
                },
                {
                    path: 'follow',
                    name: 'follow',
                    component: () => import('@/views/follow/index.vue')
                },
                {
                    path: 'liked',
                    name: 'liked',
                    component: () => import('@/views/liked/index.vue')
                },
                {
                    path: 'recent',
                    name: 'recent',
                    component: () => import('@/views/recent/index.vue')
                },
                {
                    path: 'my-podcast',
                    name: 'my-podcast',
                    component: () => import('@/views/my-podcast/index.vue')
                },
                {
                    path: 'favorites',
                    name: 'favorites',
                    component: () => import('@/views/favorites/index.vue')
                }
            ],
        },
    ]
})

export default router